package design.simdi.code.final_paper.site.panels.proiecte.idei;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.IdeaDao;
import design.simdi.code.final_paper.core.entities.Idea;

/**
 * 
 * @author Marius Dumitriu - (Jun 21, 2010 - 1:40:28 PM)
 * 
 */
public class DetachableIdeaModel extends LoadableDetachableModel<Idea> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final IdeaDao IdeaDao;

	public DetachableIdeaModel(Idea object, IdeaDao IdeaDao) {
		super(object);
		this.id = object.getId();
		this.IdeaDao = IdeaDao;
	}

	@Override
	protected Idea load() {
		return IdeaDao.get(id);
	}

}
